package com.aptemo.webetek.server.handlers;

import com.aptemo.webetek.client.commands.Action;
import com.aptemo.webetek.client.commands.impl.RemovePlayerAction;
import com.aptemo.webetek.client.commands.responses.ResponseStatus;
import com.aptemo.webetek.client.exceptions.BackendException;
import com.aptemo.webetek.client.exceptions.WebetekLoginException;
import com.aptemo.webetek.server.datastore.DataStoreAPI;

public class DeletePlayerHandler
		extends ActionHandler<RemovePlayerAction, ResponseStatus>
{

	public DeletePlayerHandler(DataStoreAPI service)
	{
		super(service);
	}

	public Class<? extends Action<?>> getActionType()
	{
		return RemovePlayerAction.class;
	}

	@Override
	public ResponseStatus invoke(RemovePlayerAction action) throws BackendException, WebetekLoginException
	{

		return new ResponseStatus(dataService.deletePlayer(action.getId()));
	}

}
